//
//  TKL_mypubCell.m
//  TKL_EnPro
//
//  Created by 雅恩三河科技 on 2018/12/18.
//  Copyright © 2018年 MrZhang. All rights reserved.
//

#import "TKL_mypubCell.h"

@interface TKL_mypubCell ()
@property(nonatomic,strong)UIImageView* leftIV;
@property(nonatomic,strong)UILabel* titleLab;
@property(nonatomic,strong)UILabel* phoneLab;
@end

@implementation TKL_mypubCell
#pragma mark - getter and setter
-(UIImageView *)leftIV
{
    if (!_leftIV) {
        _leftIV=[UIImageView new];
        _leftIV.x=(SCREEN_WIDTH-WFCGFloatY(180));
        _leftIV.y=WFCGFloatY(10);
        _leftIV.width=WFCGFloatX(160);
        _leftIV.height=WFCGFloatY(110);
        _leftIV.backgroundColor=[UIColor whiteColor];
        [WFFunctions WFUIaddbordertoView:_leftIV radius:5 width:0 color:[UIColor whiteColor]];
    
        
    }
    return _leftIV;
}
-(UILabel *)titleLab
{
    if (!_titleLab) {
        _titleLab=[UILabel new];
        _titleLab.x=WFCGFloatX(10);
        _titleLab.y=WFCGFloatY(20);
        _titleLab.width=WFCGFloatX(160);
        _titleLab.height=WFCGFloatY(15);
        _titleLab.font=SYSTEMFONT(15);
        _titleLab.textColor=HEXCOLOR(@"#333333");
        _titleLab.numberOfLines=5;
        
    }
    return _titleLab;
}
-(UILabel *)phoneLab
{
    if (!_phoneLab) {
        _phoneLab=[UILabel new];
        _phoneLab.x=WFCGFloatX(10);
        _phoneLab.y=WFCGFloatY(100);
        _phoneLab.width=WFCGFloatX(160);;
        _phoneLab.height=WFCGFloatY(14);
        _phoneLab.font=SYSTEMFONT(13);
        _phoneLab.textColor=HEXCOLOR(@"#666666");

    }
    return _phoneLab;
}
#pragma mark - event
#pragma mark - method
#pragma mark - life
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.leftIV];
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.phoneLab];
        
    }
    return self;
}
-(void)setSourceDic:(NSMutableDictionary *)sourceDic
{
    _titleLab.text=[WFFunctions WFCheckEmptyBackStr:[sourceDic objectForKey:@"content"]];
    CGSize temSize=[WFFunctions WFStrGetSize:_titleLab.text width:_titleLab.width font:SYSTEMFONT(15)];
    _titleLab.height=temSize.height;
    
    _phoneLab.text=[WFFunctions WFCheckEmptyBackStr:[WFFunctions getDateWithTimeStamp:[sourceDic objectForKey:@"createTime"] formatter:@"yyyy-mm-dd hh:mm"]];
    [_leftIV sd_setImageWithURL:[NSURL URLWithString:[WFFunctions WFCheckEmptyBackStr:[sourceDic objectForKey:@"cover"]]] placeholderImage:DefaultImage];
}
@end
